<?php
include __DIR__."/Solution.php";

/**
 * Created by PhpStorm.
 * User: Sage
 * Date: 2019/4/11
 * Time: 11:06
 */
class SolutionTest extends  \PHPUnit\Framework\TestCase {

    /**
     * @param mixed ...$params
     * @dataProvider dataProvider
     */
    function testSolution(...$params){
        $answer=array_pop($params);
        $this->assertEquals($answer,(new Solution)->myAtoi(...$params));
    }

    function dataProvider(){
        return [
            ['42',42],
            ["   -42",-42],
            ['4193 with words',4193],
            ['words and 987',0],
            ['-91283472332',-2147483648],
            ["   -115579378e25",-115579378],
            ["3.14159",3],
            ['-',0],
            ["   +0 123",0],
            ["0-1",0],
            ['-5-',-5]
        ];
    }
}



